package com.itheima.text6;

import java.util.concurrent.CountDownLatch;

public class Chile extends Thread {
    private CountDownLatch countDownLatch;

    public Chile (CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        //吃饺子
        for (int i = 1; i <= 10; i++) {
            System.out.println(getName()+"在吃第"+i+"个饺子");

        }
        //运行结束提示
        //每一次countDown方法的时候,让计数器-1
        countDownLatch.countDown();
    }
}
